<!--
描述：艺术中心-系统管理-学生信息
开发人：hqj
开发日期：2017年12月14日
-->
<template lang="pug">
    keep-alive
        kalix-table(bizKey="student" title='学生信息列表' v-bind:targetURL="targetURL"
        v-bind:bizDialog="bizDialog" bizSearch="AdminStudentSearch" v-bind:btnList="btnList"
        v-bind:dictDefine="dictDefine" v-bind:isFixedColumn="isFixedColumn")
            template(slot="tableColumnSlot")
                kalix-date-column(prop="entranceYear" label="入学年份" align="center" width="150px")
                el-table-column(prop="majorName" label="专业" align="center" width="200px")
                el-table-column(prop="className" label="班级" align="center" width="200px")
                el-table-column(prop="code" label="学号" align="center" width="100px")
                el-table-column(prop="name" label="姓名" align="center" width="100px")
                el-table-column(prop="sexName" label="性别" align="center" width="80px")
                el-table-column(prop="birthday" label="出生日期" align="center" width="100px")
                el-table-column(prop="nation" label="民族" align="center" width="100px")
                el-table-column(prop="placeOfOrigin" label="籍贯" align="center" width="100px")
                el-table-column(prop="provinceName" label="生源省份" align="center" width="100px")
                el-table-column(prop="phone" label="联系电话" align="center" width="150px")
                el-table-column(prop="mobile" label="手机" align="center" width="150px")
                el-table-column(prop="address" label="联系地址" align="center" width="150px")
                el-table-column(prop="email" label="电子邮件" align="center" width="150px")
</template>

<script type="text/ecmascript-6">
    import {AdminCacheKey, StudentToolButtonList, StudentURL} from '../../config.toml'

    export default {
        name: 'kalix-admin-student',
        data() {
            return {
                dictDefine: [{ // 定义数据字典的显示
                    cacheKey: AdminCacheKey,
                    type: '性别',
                    targetField: 'sexName',
                    sourceField: 'sex'
                }, {
                    cacheKey: AdminCacheKey,
                    type: '省份',
                    targetField: 'provinceName',
                    sourceField: 'province'
                }],
                btnList: StudentToolButtonList,
                targetURL: StudentURL,
                bizDialog: [
                    {id: 'view', dialog: 'AdminStudentView'},
                    {id: 'edit', dialog: 'AdminStudentAdd'},
                    {id: 'add', dialog: 'AdminStudentAdd'},
                    /*{id: 'scoreManage', dialog: 'ArtScoreManage'}*/
                ],
                isFixedColumn: true
            }
        },
        components: {},
        created() {
        },
        methods: {
            /*customTableTool(row, btnId, that) {
                switch (btnId) {
                    case 'newEdit' : { // 新编辑
                        that.whichBizDialog = ''
                        let dig =
                            that.bizDialog.filter((item) => {
                                return item.id === 'newEdit'
                            })
                        that.whichBizDialog = dig[0].dialog
                        setTimeout(() => {
                            if (row.id && row.id > 0) { // 修改
                                that.$refs.kalixDialog.$refs.kalixBizDialog.open('编辑', true, row)
                            } else { // 新增
                                this.$delete(row, 'version')
                                this.$delete(row, 'version_')
                                that.$refs.kalixDialog.$refs.kalixBizDialog.open('编辑', false, row)
                            }
                        }, 20)
                        break
                    }
                    case 'scoreManage' : { // 成绩管理
                        that.whichBizDialog = ''
                        let dig =
                            that.bizDialog.filter((item) => {
                                return item.id === 'scoreManage'
                            })
                        that.whichBizDialog = dig[0].dialog
                        setTimeout(() => {
                            that.$refs.kalixDialog.openDialog(row)
                        }, 20)
                        break
                    }
                }
            }*/
        }
    }
</script>

<style scoped lang="stylus">
</style>
